<!--This file represents the list of job and appropriate nested jobtypes -->
<ul id="jobs_menu">
	<li>
	<a href="#">_('jobs')</a>
	<ul id="jobs_menu">
	{{#jobs}}
		<li id="job_{{jobid}}">
		<a href="#">{{jobtitle}}</a>
			<ul>
				{{#jobtypes}}
					<li id="jobtype_{{jobtypeid}}">
						<a href="#">{{jobtypetitle}}</a>
					</li>
				{{/jobtypes}}
			</ul>
		</li>
	{{/jobs}}
	</ul>
	<li>
</ul>
<script>		
	$("#jobs_menu").menu({select: function( event, ui )
	{
		console.log('id = ' + ui.item.attr('id'));
		if(ui.item.attr('id').contains('jobtype')) // we track only leaves not nodes in general.
		{
			$('#employeejob_edit_currentjobtype').trigger('jobtypes_menu_selected',[ui.item.attr('id'),  ui.item.text()]);
			console.log('from dialog' + ui.item.text() + ' ' + ui.item.attr('id'));
		}
	}}).ready(function(){console.log('jobs_menu ready!')});
</script>